import views from '@mxpio/views';
import flow from '@mxpio/flow';
import dbconsole from '@mxpio/dbconsole';
import demo from '@mxpio/demo';

const modules = import.meta.glob('./modules/**/*.ts', { eager: true });

const modulesComponents = {};

Object.keys(modules).forEach((key) => {
  const mod = (modules as Recordable)[key].default || {};
  Object.assign(modulesComponents, mod);
});
const LAYOUT = () => Promise.resolve(import('@mxpio/layouts/src/default/index.vue'));

export const pages = {
  LAYOUT,
  ...views,
  ...flow,
  ...dbconsole,
  ...demo,
  ...modulesComponents,
};
export default pages;
